<!-- The Right Sidebar -->
<aside class="control-sidebar control-sidebar-light select-news">
	<div class="control-sidebar-close" ><i class="fa fa-close" onclick="show_right()"></i>
	<a class="btn btn-sm btn-success" href="{{ admin_base_path('positionlist/create') }}?position_id={{request()->get('position_id')}}" style="float:right; margin-right:10px; display: none" ><i class="fa fa-save"></i> 新增</a>
	</div>
  <!-- Content of the sidebar goes here -->
	<div class="form-group">
		<div class="col-sm-8">
			<div class="input-group">
				<span class="input-group-addon"><i class="fa fa-pencil fa-fw"></i></span>
				<input type="text" id="title_keyword" name="title" value="" class="form-control name" placeholder="输入关键词">
			</div>
		</div>
		<label for="name" class="col-sm-2  control-label">
			<a class="btn btn-sm btn-primary" onclick="search_news()"><i class="fa fa-search"></i> 搜索</a>
			
		</label>
	</div>	
	<div class="form-group " style="width: 100%; overflow: hidden; display: none">	
		
		<div class="col-sm-8">


		        <select class="form-control temp_id" style="width: 100%;" name="type"  id="type">
                                    <option value="news" selected="selected">新闻</option>
                                   
                                    </select>

        
    	</div>
    	<label for="name" class="col-sm-2  control-label">
			搜索类型
			
		</label>
	</div>	
	

	<div class="html_result"></div>
	
</aside>
<!-- The sidebar's background -->
<!-- This div must placed right after the sidebar for it to work-->
<div class="control-sidebar-bg select-news-bg"></div>

<script>
function search_news()
{
	var k = $('#title_keyword').val();
	var type = $('#type').val();
	$.post('/admin/'+ type +'/keyword?position_id={{request()->get("position_id")}}',{k: k, _token: LA.token},function(res){
		if(res.status==1)
		{
			$('.html_result').html(res.content);
		}else{
			toastr.success(res.msg);
		}
	},'json')
}
function select_news(id)
{
	$.post('/admin/positionlist/select_news',{id: id, _token: LA.token},function(res){
		if(res.status==1)
		{
			$('.html_result').html(res.content);
		}else{
			toastr.success(res.msg);
		}
	},'json')
}
</script>
